package game.model;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * @author fank
 * @date 2018-08-22 10:13
 * @desc 小游戏元素
 **/
public enum MType {
    /**0.5倍金币*/
    GLOD_HALF(true, 0.5f),
    /** 1倍金币*/
    GLOD_ONE(true, 1.0f),
    /** 两倍金币*/
    GLOD_TWO(true, 2.0f),
    /** 三倍金币*/
    GLOD_THREE(true, 3.0f),
    /** 5倍金币*/
    GLOD_FIVE(true, 5.0f),
    /** 花*/
    FLOWER,
    /** 飞镖*/
    DART;
    private boolean gold = false;
    private float scoper;

    MType() {
    }

    MType(boolean gold, float scoper) {
        this.gold = gold;
        this.scoper = scoper;
    }

    public static List<MType> get() {
        List<MType> results = new ArrayList<>();
        //4朵花
        for (int i = 0; i < 4; i++) {
            results.add(FLOWER);
        }
        //4个镖
        for (int i = 0; i < 4; i++) {
            results.add(DART);
        }
        //8个金币
        results.add(GLOD_HALF);
        results.add(GLOD_HALF);
        results.add(GLOD_ONE);
        results.add(GLOD_ONE);
        results.add(GLOD_TWO);
        results.add(GLOD_TWO);
        results.add(GLOD_THREE);
        results.add(GLOD_FIVE);
        Collections.shuffle(results);
        return results;
    }

    public int getIn() {
        return 0;
    }

    public boolean isGold() {
        return gold;
    }

    public float getScoper() {
        return scoper;
    }
}
